#ifndef  _DL_IO_DATA_H_
#define  _DL_IO_DATA_H_

#include "stdint.h"

typedef struct dl_frm_predat_s  dl_frm_predat_t;
typedef struct dl_io_data_s     dl_io_data_t;
typedef struct cmd_s            cmd_t;


typedef int (*SEND_DATA_FN)(int client, uint8_t* pdata, uint32_t len);


#pragma pack(push,1)


#define  FRM_NOT_ENOUGH  -1

// io type
typedef enum
{
    IO_TYPE_UDP = 0,
    IO_TYPE_TCP,
    IO_TYPE_SP,
}enum_io_type;

struct dl_frm_predat_s
{
    unsigned short      ver;           // protocol version number
    unsigned long long  session;       // session id
    unsigned int        sn;            // frame serial number
    unsigned int        cmdid;         // 
};
struct dl_io_data_s
{
    uint8_t           * pcmd;         // frame
    int                 pIO;          // io handle
    int               cmdlen;         // frame length
    int               io_type;        // type
    SEND_DATA_FN      send_data;      // send function
};


#pragma pack(pop)

#endif // #ifndef  _DL_IO_DATA_H_
